/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Object;

import GamePlay.CanvasGame;
import javax.microedition.lcdui.Graphics;

/**
 *
 * @author Black Diamond
 */
public class Piece {

    public static int w_p = 50;
    public static int h_p = 50;
    public static int w_l = 50;
    public static int h_l = 50;
    private int id;
    private int x;
    private int y;
    private int i;
    private int j;
    private int img;
    private boolean visible;
    private CanvasGame canvas;

    public Piece(CanvasGame canvas, int i, int j, int x, int y, int img) {
        this.x = x;
        this.y = y;
        this.i = i;
        this.j = j;
        this.img = img;
        this.visible = true;
        this.canvas = canvas;
    }

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    public int getJ() {
        return j;
    }

    public void setJ(int j) {
        this.j = j;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getImg() {
        return img;
    }

    public void setImg(int img) {
        this.img = img;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }
    
    public void draw(Graphics g) {
        g.drawImage(canvas.getResource().getIMG(img), x, y, Graphics.TOP | Graphics.LEFT);
//        canvas.getImage().drawImagePart(g, canvas, img, x, y, 0, state*h, w, h);    
    }
}